package com.cskaoyan.bean.chaosbean.stat;

import java.lang.reflect.Field;
import java.util.List;

/**
 * @author 楚夏三分
 * @datetime 2022/12/30 20:30
 * @description: TODO:
 */
public class Demo <T> {
    // 泛型T的所有成员变量名List
    List<String> names;
    List<T> t;


    public <T> Demo(T t) {
        Field[] declaredFields = t.getClass().getDeclaredFields();
        for (Field declaredField : declaredFields) {
            String name = declaredField.getName();
            names.add(name);
        }
    }
}


